home *** CD-ROM | disk | FTP | other *** search
/ Game Cracker (Expanded Edition) / Game Cracker (Expanded Edition).iso / cracks / SV_VSQD.ZIP / Virtua Squad 1.txt < prev    next >
Encoding:
Text File  |  1998-03-18  |  13.1 KB  |  250 lines

  1.  
  2. Free Information Xchange '98 presents:
  3.  
  4. Virtua Squad - CD crack by Static Vengeance
  5.  
  6. Requirements:
  7. hex editor and full install
  8.  
  9.     Having already played (and cracked) Virtua Squad 2 (VS2), I thought I would look at Virtua Squad.
  10. The first game is a bit older and as such doesn't support Direct3D which is shame.  However the game has
  11. different "cases" (locations) to play so I decided to crack this one too.  And as long as I am going to go
  12. through the effort I thought I would pass along what I learned from this one.  First the CD check routine
  13. is nearly the same as the one used in VS2, but I added a few other comments to Virtua Squad's routine.  Okay,
  14. lets get started, you will need to use W32Dasm to follow along.  Alright, first thing you need to do is to
  15. disassemble the exe file ppjdd.exe.  Now when you run the game without the CD a dialog box comes up right
  16. away and asks for the CD, no network option like VS2.  However, unlike VS2, there is a string ref you will
  17. find while in W32Dasm.  Using the same old method, go up to the menu bar and select "Refs" and then select
  18. "String data references" from the drop down menu.  Then from the Refs box, grab the slider bar and scroll down.
  19. You will find the following string refs to check out: "Please insert VIRTUA SQUAD CD."  and like VS2 there is
  20. a ref to the executable file on the CD with volume (path) name for you to check out:  "NATIVE\VCOP\PPJDD.EXE"
  21.   So double click on the "Please insert..." ref and that will drop you right in the middle of the routine
  22. that checks for the CD.  If you doulble click on the exe file's path you will be in the middle of the code
  23. that looks for the file on the CD, which is actual CD check.  So let's begin with the section that asks
  24. the user to put the CD in the drive and see where things go from there:
  25.  
  26. * Referenced by a CALL at Address:
  27. |:004094D6                                   <-- Where the called came from, we'll make use of this later
  28. |
  29. :0040AEA0 56                      push esi
  30.  
  31. * Reference To: USER32.MessageBoxA, Ord:0197h
  32.                                   |
  33. :0040AEA1 8B3530C42D01            mov esi, dword ptr [012DC430]
  34.  
  35. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  36. |:0040AEDB(C)
  37. |
  38. :0040AEA7 E864FFFFFF              call 0040AE10                  <-- Actual CD check routine (see below)
  39.  
  40. * Possible StringData Ref from Data Obj ->"VIRTUA SQUAD"
  41.                                   |
  42. :0040AEAC 8B0D10674800            mov ecx, dword ptr [00486710]
  43. :0040AEB2 A3EC452D01              mov dword ptr [012D45EC], eax  <-- Get the result of the CD check from here
  44. :0040AEB7 83F8FF                  cmp eax, FFFFFFFF              <-- Compare against known fail value
  45. :0040AEBA A1202D2D01              mov eax, dword ptr [012D2D20]
  46. :0040AEBF 7520                    jne 0040AEE1                   <-- Take this jump if the CD check passed
  47. :0040AEC1 6A35                    push 00000035                  <-- Otherwise "fall" through and ask for
  48. :0040AEC3 85C0                    test eax, eax                  <-- the user to put the CD in the drive.
  49. :0040AEC5 51                      push ecx
  50. :0040AEC6 7407                    je 0040AECF
  51.  
  52. * Possible StringData Ref from Data Obj ->"VIRTUA SQUAD "
  53.                                   |
  54. :0040AEC8 6890684800              push 00486890
  55. :0040AECD EB05                    jmp 0040AED4
  56.  
  57. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  58. |:0040AEC6(C)
  59. |
  60. * Possible StringData Ref from Data Obj ->"Please insert VIRTUA SQUAD CD."  <-- String which lead us here
  61.                                   |
  62. :0040AECF 6870684800              push 00486870
  63.  
  64. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  65. |:0040AECD(U)
  66. |
  67. :0040AED4 6A00                    push 00000000
  68. :0040AED6 FFD6                    call esi                      <-- Do the pop up dialog box
  69. :0040AED8 83F802                  cmp eax, 00000002             <-- 00000002 means you hit "cancel"
  70. :0040AEDB 75CA                    jne 0040AEA7                  <-- Otherwise loop back up and check again
  71. :0040AEDD 33C0                    xor eax, eax                  <-- A zero in eax means CD check failed
  72. :0040AEDF 5E                      pop esi
  73. :0040AEE0 C3                      ret                           <-- Return to caller with result
  74.  
  75. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  76. |:0040AEBF(C)
  77. |
  78. :0040AEE1 B801000000              mov eax, 00000001             <-- A one in eax means CD check passed!
  79. :0040AEE6 5E                      pop esi
  80. :0040AEE7 C3                      ret                           <-- Return to caller
  81.  
  82.     That was the code that asks the user to put the CD in the drive if not found during the CD check.
  83. We now have enough information to crack this one.  We know where the call to the above routine is made
  84. from and we know a successful call returns with 00000001 in eax.  However, becuase this is a tutorial I'll
  85. also show you the routine that checks for the CD.  That routine is at 40AE10 and looks alot like this:
  86.  
  87. * Referenced by a CALL at Address:
  88. |:0040AEA7   
  89. |
  90. :0040AE10 83EC50                  sub esp, 00000050
  91. :0040AE13 53                      push ebx
  92. :0040AE14 56                      push esi
  93. :0040AE15 57                      push edi
  94. :0040AE16 33DB                    xor ebx, ebx                   <-- Try/retry counter, zero it out
  95. :0040AE18 55                      push ebp
  96.  
  97. * Reference To: KERNEL32.GetLogicalDrives, Ord:00E7h             <-- Good text string to search for is
  98.                                   |                              <-- "GetLogicalDrives"
  99. :0040AE19 FF15E8C32D01            Call dword ptr [012DC3E8]
  100. :0040AE1F 8BE8                    mov ebp, eax
  101.  
  102. * Reference To: KERNEL32._lopen, Ord:0262h
  103.                                   |
  104. :0040AE21 8B350CC42D01            mov esi, dword ptr [012DC40C]
  105.  
  106. * Reference To: KERNEL32.GetDriveTypeA, Ord:00CEh                <-- Another useful text string would be
  107.                                   |                              <-- "GetDriveType"
  108. :0040AE27 8B3DD4C32D01            mov edi, dword ptr [012DC3D4]
  109.  
  110. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  111. |:0040AE7F(C)
  112. |
  113. :0040AE2D B801000000              mov eax, 00000001
  114. :0040AE32 8ACB                    mov cl, bl
  115. :0040AE34 D3E0                    shl eax, cl
  116. :0040AE36 85C5                    test ebp, eax
  117. :0040AE38 7441                    je 0040AE7B
  118. :0040AE3A 8D4341                  lea eax, dword ptr [ebx+41]
  119. :0040AE3D 8D4C2410                lea ecx, dword ptr [esp+10]
  120. :0040AE41 50                      push eax
  121.  
  122. * Possible StringData Ref from Data Obj ->"%c:\"                <-- Commonly used Ref string in CD checks
  123.                                   |
  124. :0040AE42 6868684800              push 00486868
  125. :0040AE47 51                      push ecx
  126.  
  127. * Reference To: USER32.wsprintfA, Ord:026Ch
  128.                                   |
  129. :0040AE48 FF15A4C42D01            Call dword ptr [012DC4A4]
  130. :0040AE4E 8D4C241C                lea ecx, dword ptr [esp+1C]
  131. :0040AE52 83C40C                  add esp, 0000000C
  132. :0040AE55 51                      push ecx
  133. :0040AE56 FFD7                    call edi
  134. :0040AE58 83F805                  cmp eax, 00000005
  135. :0040AE5B 751E                    jne 0040AE7B
  136. :0040AE5D 8D442410                lea eax, dword ptr [esp+10]
  137.  
  138. * Possible StringData Ref from Data Obj ->"NATIVE\VCOP\PPJDD.EXE"  <-- File to check for with the CD path
  139.                                   |
  140. :0040AE61 6850684800              push 00486850
  141. :0040AE66 50                      push eax
  142.  
  143. * Reference To: KERNEL32.lstrcatA, Ord:0266h
  144.                                   |
  145. :0040AE67 FF15D0C32D01            Call dword ptr [012DC3D0]
  146. :0040AE6D 8D442410                lea eax, dword ptr [esp+10]
  147. :0040AE71 6A00                    push 00000000
  148. :0040AE73 50                      push eax
  149. :0040AE74 FFD6                    call esi
  150. :0040AE76 83F8FF                  cmp eax, FFFFFFFF
  151. :0040AE79 7508                    jne 0040AE83                <-- Take this jump if the file was read
  152.  
  153. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  154. |:0040AE38(C), :0040AE5B(C)
  155. |
  156. :0040AE7B 43                      inc ebx                     <-- Made another check, add 1 to ebx
  157. :0040AE7C 83FB20                  cmp ebx, 00000020           <-- Try up to 20h (32) times
  158. :0040AE7F 7CAC                    jl 0040AE2D                 <-- Keep trying to find the CD until you hit 32
  159. :0040AE81 EB07                    jmp 0040AE8A                <-- Tried 32 times and STILL didn't find it
  160.  
  161. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  162. |:0040AE79(C)
  163. |
  164. :0040AE83 50                      push eax
  165.  
  166. * Reference To: KERNEL32._lclose, Ord:025Fh
  167.                                   |
  168. :0040AE84 FF15CCC32D01            Call dword ptr [012DC3CC]
  169.  
  170. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  171. |:0040AE81(U)
  172. |
  173. :0040AE8A B8FFFFFFFF              mov eax, FFFFFFFF        <-- This is the fail value
  174. :0040AE8F 83FB20                  cmp ebx, 00000020        <-- Did we fail to find the file 32 times?
  175. :0040AE92 7402                    je 0040AE96              <-- If yes, take this jump  CD check=fail
  176. :0040AE94 8BC3                    mov eax, ebx             <-- This is THE vital instruction for pass/fail
  177.                                                            <-- anything other than FFFFFFFF = pass
  178. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  179. |:0040AE92(C)
  180. |
  181. :0040AE96 5D                      pop ebp
  182. :0040AE97 5F                      pop edi
  183. :0040AE98 5E                      pop esi
  184. :0040AE99 5B                      pop ebx
  185. :0040AE9A 83C450                  add esp, 00000050
  186. :0040AE9D C3                      ret                      <-- Finally return to the caller
  187.  
  188.     While it's not completely important that you understand each and every instruction and or compare,
  189. you need to see (understand) the general "flow" of the code.  You start off by getting the drive location
  190. (ie drive D, or whatever, is the CD rom), then check for the file on the CD.  The one thing that you really
  191. need to pay attention to is the "return to caller" section of the routine.  This is where the vital choise
  192. is made between pass or fail.  Then back track (through the callers) and find a "good" spot to make your
  193. patch.  One method of cracking Virtua Squad would be to change the je 0040AE96 (at 40AE94) to two NOP's.
  194. This would allow the code to fall through and set up for a "good" CD check (the mov eax, ebx).  However,
  195. I have always believed, why actually go through the CD check routine if you don't HAVE to, right?  That's
  196. why I back track up to a higher level to disable the routine.  As such, let's take a look at the first
  197. section of code where it was called from 4094D6.  We need to list the surounding code (at 4094D6) and see
  198. what we have.
  199.  
  200.   -- Program Code --
  201. :004094CD 8B44243C                mov eax, dword ptr [esp+3C]
  202. :004094D1 A300152D01              mov dword ptr [012D1500], eax
  203.  
  204. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  205. |:004094B2(C)
  206. |
  207. :004094D6 E8C5190000              call 0040AEA0         <-- Do the whole CD check routine
  208. :004094DB 85C0                    test eax, eax         <-- Test the value returned in eax
  209. :004094DD 750C                    jne 004094EB          <-- Take this jump for a good CD check
  210. :004094DF 33C0                    xor eax, eax          <-- Otherwise set up to quit back to Win95
  211. :004094E1 5D                      pop ebp
  212. :004094E2 5F                      pop edi
  213. :004094E3 5E                      pop esi
  214. :004094E4 5B                      pop ebx
  215. :004094E5 83C420                  add esp, 00000020
  216. :004094E8 C21000                  ret 0010
  217.  
  218. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  219. |:004094DD(C)
  220. |
  221. :004094EB 8B7C2440                mov edi, dword ptr [esp+40]
  222. :004094EF 57                      push edi
  223. :004094F0 53                      push ebx
  224. :004094F1 E87A020000              call 00409770
  225. :004094F6 83C408                  add esp, 00000008
  226.   -- Continuing Program Code --
  227.  
  228.     From here you can see the "only" thing you need to do is to change the call to the CD check to
  229. mov eax, 00000001.  This will in turn force the jne 4094EB to always be taken.  Which, of course, allows
  230. you to play Virtua Squad without having the CD in your CD Rom drive!  Now you need to make the patch to
  231. file.  There are two versions of the game on the CD that I had to look at.  One for Direct Draw called
  232. ppjdd.exe and one that's a native NVida port called vcop.exe.  Too bad there's not a D3D version or a
  233. native glide port for this game.  Anyways, here are the edits for both files:
  234.  
  235. Edit ppjdd.exe at offset 35,030
  236. ===============================
  237. Search for: E8 C5 19 00 00
  238. Chagne to : B8 01 00 00 00
  239.  
  240. Edit vcop.exe at offset 266,968
  241. ===============================
  242. Search for: E8 B7 17 00 00
  243. Chagne to : B8 01 00 00 00
  244.  
  245.     Another game has been FiX'ed with a little help from your humble author...  Until next time,
  246. practice on something and put out a tutorial for the rest of us to read.  That way I'll know someone
  247. is reading (and learning from) these articles I put out.
  248.  
  249. Static Vengeance
  250.